import request from '@/utils/request'

// 查询公共违禁词列表
export function listBlock(query) {
  return request({
    url: '/bot/block/list',
    method: 'get',
    params: query
  })
}

// 查询公共违禁词详细
export function getBlock(id) {
  return request({
    url: '/bot/block/' + id,
    method: 'get',
    headers: {
      custom:{
        showLoading:true
      }
    }
  })
}

// 新增公共违禁词
export function addBlock(data) {
  return request({
    url: '/bot/block',
    method: 'post',
    data: data,
    headers: {
      custom:{
        showLoading:true,
        loadingMsg:'处理中...'
      }
    }
  })
}

// 修改公共违禁词
export function updateBlock(data) {
  return request({
    url: '/bot/block',
    method: 'put',
    data: data,
    headers: {
      custom:{
        showLoading:true,
        loadingMsg:'处理中...'
      }
    }
  })
}

// 删除公共违禁词
export function delBlock(id) {
  return request({
    url: '/bot/block/' + id,
    method: 'delete',
    headers: {
      custom:{
        showLoading:true,
        loadingMsg:'处理中...'
      }
    }
  })
}

// 导入到群
export function importToChat(chatId,id) {
  return request({
    url: '/bot/block/' + chatId +'/'+id,
    method: 'post',
    headers: {
      custom:{
        showLoading:true,
        loadingMsg:'处理中...'
      }
    }
  })
}
